package com.hxalex.simulationhandle.accessbilityService.receiver.search;

import android.util.Log;
import android.view.accessibility.AccessibilityNodeInfo;

import com.hxalex.simulationhandle.accessbilityService.manger.SearchManger;
import com.hxalex.simulationhandle.accessbilityService.receiver.base.BaseReceiver;

/**
 * Created by hx_Alex on 2018/5/26.
 */

public class EditSearchContentReceiver extends BaseReceiver {
    private AccessibilityNodeInfo nodeInfo;
    private String  editContent;
    public EditSearchContentReceiver(SearchManger searchManger) {
        super(searchManger);
        FLAG="输入搜索内容命令";
    }

    public AccessibilityNodeInfo getNodeInfo() {
        return nodeInfo;
    }

    public void setNodeInfo(AccessibilityNodeInfo nodeInfo) {
        this.nodeInfo = nodeInfo;
    }

    public void setEditContent(String editContent) {
        this.editContent = editContent;
    }


    @Override
    public void doSomething() {
        if(!isPrintCommandMsg)
        {
            Log.w("EditSearchContent","开始执行"+FLAG);
            isPrintCommandMsg=true;
        }
        if(nodeInfo==null) return;
        if(searchManger.editSearchContent(nodeInfo))
        {
            commandCompleteListener.commandCompleteListener();
        }
       
    }
}
